<template>
  <div class="days">
    <el-input v-model="day" placeholder=""></el-input>
    天
    <el-input v-model="light" placeholder=""></el-input>
    夜
  </div>
</template>

<script>
export default {
  name: 'days',
  props: {
    defaultValue: {
      type: Array,
      default: () => []
    },
  },
  computed: {
    day: {
      get () {
        return this.defaultValue.length ? this.defaultValue[0] : ''
      },
      set (v) {
        this.$emit('EventHandler', 'change', this.$attrs.prop, [v, this.defaultValue[1]])
        // this.$set(this.defaultValue, 0, v)
      }
    },
    light: {
      get () {
        return this.defaultValue.length ? this.defaultValue[1] : ''
      },
      set (v) {
        // this.$set(this.defaultValue, 1, v)
        this.$emit('EventHandler', 'change', this.$attrs.prop, [this.defaultValue[0], v])
      }
    }
  },
  data () {
    return {
    }
  },
  
}
</script>

<style lang="scss">
.days{
  .el-input{
    width: 100px;
  }
}
</style>